from django.shortcuts import render
from django.views.decorators.cache import cache_page

from common.models import Province


@cache_page(300)
def home(request):
    prov_list = Province.objects.all()
    ctx = {
        'prov_list': prov_list,
    }
    return render(request, 'index.html', ctx)


def publish(request):
    prov_list = Province.objects.all()
    ctx = {
        'prov_list': prov_list,
    }
    return render(request, 'pub.html', ctx)
